package KK.net.Proxy
{
	import KK.Data.ProtocolData;
	import KK.EMVC.Control.Control;
	import KK.net.Event.SocketEvent;
	import KK.net.ProxyManager;
	import KK.net.SocketManager;
	
	import flash.utils.ByteArray;

	public class Proxy extends Control implements IProxy
	{
		public function Proxy()
		{
			//TODO: implement function
			super(); 
		}
		
		/**
		 * 发送  
		 * @param byte
		 * 
		 */
		public function Send(CommandID:int,data:ProtocolData):void{
			var byte:ByteArray=ProtocolData.Creator(); 
			data.Serialize(byte);
			Publish(new SocketEvent(SocketEvent.SEND,CommandID,byte));
		}
		/**
		 * 发送字节流  
		 * @param CommandID
		 * @param byte
		 * 
		 */
		public function SendByte(CommandID:int,byte:ByteArray):void{
			Publish(new SocketEvent(SocketEvent.SEND,CommandID,byte));
		}
	}
}